
#ifndef	__UR_IMPLEMENT_H
#define	__UR_IMPLEMENT_H

typedef enum{
	UR_SEND_CMD_NONE,
    UR_SEND_CMD_LOGIN,
    UR_SEND_CMD_LOGIN_FAIL,
	UR_SEND_CMD_LOGOUT,
	UR_SEND_CMD_LOGOUT_FAIL,
	UR_SEND_CMD_TOTAL_AUTH_CARD,
	UR_SEND_CMD_AUTH_CARD,
	UR_SEND_CMD_SET_MODE,
	UR_SEND_CMD_VERSION,
	UR_SEND_CMD_SET_CONSUME_MODE,
	
	UR_SEND_CMD_KEY_MODE,
	UR_SEND_CMD_KEY_CONFIGURE,
	UR_SEND_CMD_KEY_MONEY,
	UR_SEND_CMD_KEY_PASSWORD,
}UR_SEND_CMD_E;

#define UR_SEND_CMD_SET_CONSUME_MODE_LEN	1

typedef enum{
	UR_SEND_STATUS_IDLE,
	UR_SEND_STATUS_SENDED_AND_WAIT_OK
}UR_SEND_STATUS_E;

typedef enum{
	EDIT_AUTH_CARD_ADD,
	EDIT_AUTH_CARD_DEL
}EDIT_AUTH_CARD_TYPE_E;

//#define CARD_SRN_LEN 8

#define UR_SEND_PARA_LEN 8

#define UR_SEND_BUFFER_LEN 20

#define UR_SEND_RETRY_TIME 20

#define AUTH_SEND_INTERVAL_TIME_CON 10


extern idata u8 ur_send_timer;

extern UR_SEND_STATUS_E ur_s_status;

//extern idata u8 auth_card_srn[5][CARD_SRN_LEN];

extern void ur_implement_init(void);

extern void ur_implement_loop(void);

extern void ur_implement_send_task(void);

extern void ur_send_cmd(UR_SEND_CMD_E cmd,u8 *para,u8 para_len);

extern void ur_implement_timer(void);

extern UR_SEND_STATUS_E ur_get_send_status(void);

extern void ur_set_send_status(UR_SEND_STATUS_E st);

extern void ur_implement_send_ok(void);

//extern void auth_card_init(void);

//extern void edit_auth_card(EDIT_AUTH_CARD_TYPE_E ty,u8 *c_srn);

extern void ur_calculate_checksum(u8 *cs,u8 *src,u8 src_len);

extern u8 ur_checksum_if_is_ok(u8 *frm,u8 len);

//extern u8 card_if_is_auth_card(u8 *snr);

#endif

